/**
 * Created by Asura on 2016/2/3.
 * 文件流读写
 */
var fs = require('fs');

var readStream = fs.ReadStream('mysql.chm');
var writeStream = fs.WriteStream('mysql_cpy.chm');

//readStream.setEncoding('utf8');
//readStream.on('data', function (chunk) {
//    writeStream.write(chunk);
//    console.log('写入'+chunk.length);//65536一次最多读64k
//});
//writeStream.on('close', function () {
//    writeStream.end();
//    console.log('end');
//});

/**
 * 管道连接输入输出流
 */
readStream.pipe(writeStream);